package de.justphil.tcg.tcgandroidclient.network;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Connectivity {
	private ConnectivityManager cm;
	
	public boolean isInternetConnection(Context c) {
    	cm = (ConnectivityManager) c.getSystemService(Context.CONNECTIVITY_SERVICE);
    	NetworkInfo n = cm.getActiveNetworkInfo();
		if (n != null && n.isAvailable() && n.isConnected()) {
			return true;
		}
		
		return false;
    }
}
